<template>
  <div class="abstract-wrapper">
    <NoteAbstractItem
      v-for="(item) in currentPageData"
      :key="item.path"
      :item="item"
      :currentPage="currentPage"
      :currentTag="currentTag"
    />
  </div>
</template>

<script>
import NoteAbstractItem from "./NoteAbstractItem";

export default {
  components: { NoteAbstractItem },
  props: ["data", "currentPage", "currentTag"],
  computed: {
    currentPageData() {
      // const start = this.currentPage * 5 - 5;
      // const end = this.currentPage * 5;
      const start = (this.currentPage - 1) * this.$perPage;
      const end = this.currentPage * this.$perPage;
      return this.data.slice(start, end);
    }
  }
};
</script>

<style lang="stylus" scoped>
.abstract-wrapper {
  width: 100%;
}
</style>
